
//日志等级模块
#ifndef __M_LOGLEVEL_H__
#define __M_LOGLEVEL_H__

#include <iostream>

namespace xglog
{
    struct LogLevel
    {
        enum class value
        {
            UNKOWN=0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };

        //将日志等级转化为对用的字符串
        static const char* toString(xglog::LogLevel::value level)
        {
            switch(level)
            {
                case xglog::LogLevel::value::DEBUG: return "DEBUG";
                case xglog::LogLevel::value::INFO: return "INFO";
                case xglog::LogLevel::value::WARN: return "WARN";
                case xglog::LogLevel::value::ERROR: return "ERROR";
                case xglog::LogLevel::value::FATAL: return "FATAL";
                case xglog::LogLevel::value::OFF: return "OFF";

            }
            return "UNKOWN";
        }
    };
}

#endif